import Fluent

struct CreateReferenceImage: Migration {
    
    func prepare(on database: Database) -> EventLoopFuture<Void> {
        database.schema("referenceimage")
            .id()
            .field("fileOcId", .string)
            .field("imageShouldBeDeleted", .bool)
            .field("isChecked", .bool)
            .field("canBeShownInExhibitionMode", .bool)
            .field("productGroupBreedersBroilers", .bool)
            .field("productGroupBreedersLayers", .bool)
            .field("productGroupBroilersColony", .bool)
            .field("productGroupLayersAlternative", .bool)
            .field("productGroupLayersConventional", .bool)
            .field("productGroupLayersEnriched", .bool)
            .field("productGroupManureComposting", .bool)
            .field("productGroupManureDrying", .bool)
            .field("productGroupManureTransport", .bool)
            .field("productGroupOthersEggHandling", .bool)
            .field("productGroupOthersFeedHandling", .bool)
            .field("productGroupOthersOthers", .bool)
            .field("productGroupOthersVentilation", .bool)
            .field("productGroupPulletsAlternative", .bool)
            .field("productGroupPulletsConventional", .bool)
            .field("referenceID", .uuid, .required, .references("reference", "id"))


            .create()
    }
    
    func revert(on database: Database) -> EventLoopFuture<Void> {
        database.schema("users").delete()
    }
}
